package adminClient;

import java.rmi.RemoteException;

import common.AdministratorService;
import common.Tools;

public class AdminClient {

	private AdministratorService administratorService;

	public AdminClient(AdministratorService administratorService) {
		this.administratorService = administratorService;
	}

	public String getPlayerStatus(String adminName, String adminPassword,
			String adminIPAddress) throws RemoteException {
		try {
			Tools.writeLog("client", "client", "get player status started:"
					+ "adminName:" + adminName + "; adminIPAddress:"
					+ adminIPAddress, false);
			String response = administratorService.getPlayerStatus(adminName,
					adminPassword, adminIPAddress);
			Tools.writeLog("client", "client", "get player status succeeded:" + response, false);
			return response;
			
		} catch (RemoteException re) {
			Tools.writeLog("client", "client", "get player status failed:"
					+ re.detail.getMessage(), false);
			throw re;
		}
	}

}
